<template>
<!-- 顶部通栏 -->
  <AppTopNav></AppTopNav>
<!-- 头部组件 -->
  <AppHeader></AppHeader>
<!-- 吸顶头部 -->
  <AppHeaderSticky></AppHeaderSticky>
<!-- 内容容器 -->
  <div class="app-body">
    <!-- 二级路由 -->
    <RouterView></RouterView>
  </div>
<!-- 底部组件 -->
  <AppFooter></AppFooter>
</template>

<script>
import AppTopNav from '@/components/app-topnav'
import AppHeader from '@/components/app-header'
import AppFooter from '@/components/app-footer'
import AppHeaderSticky from '@/components/app-header-sticky'
import { useStore } from 'vuex'

export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: 'Layout',
  components: {
    AppHeaderSticky,
    AppTopNav,
    AppHeader,
    AppFooter
  },
  // 获取分类数据
  setup () {
    const store = useStore()
    store.dispatch('category/getList')
  }
}
</script>

<style scoped>
.app-body {
  min-height: 300px;
}
</style>
